import type { codeParams, passwordLoginParams, PatientList, User,UserInfo } from '@/types/user'

import { request } from '@/utils/request'

// 密码登录
export const loginByPasswordApi = (data: passwordLoginParams) =>
  request<User>('/login/password', 'POST', data)

// 验证码登录
export const loginByCodeApi = (data: passwordLoginParams) => request<User>('/login', 'POST', data)

//获取验证码
export const getCodeApi = (data: { mobile: string; type: codeParams }) =>
  request<User>('/code', 'get', data)

// 获取个人信息
export const getUserInfo = () => request<UserInfo>('/patient/myUser', 'get')

// 家庭档案-患者信息列表
export const getPatientList = () => request<PatientList>('/patient/mylist', 'get')
